<template>
  <el-checkbox-group>
    <el-checkbox v-for="item in items" :label="item.dictName" :value="item.dictCode">
    </el-checkbox>
  </el-checkbox-group>
</template>
<script setup lang="ts">
import { reactive } from "vue";
import { dictMapCache } from "@/api/dict/index";
import type { DictEntryModel } from "@/api/dict/os-dict-entry/types";

const props = defineProps({
  typeCode: {
    type: String,
    default: "",
  },
  enable: {
    type: Boolean,
    default: true,
  },
  class:{
    type: String,
    default: "!w-[203px]",
  }
});
const items = reactive([] as DictEntryModel[]);

dictMapCache(props.typeCode, props.enable).then((res) => {
  items.push(...res);
});
</script>
    